package com.sskj.qiangjin.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.bean.PageBean;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.qiangjin.bean.NoticeMsgBean;
import com.sskj.qiangjin.http.HttpConfig;
import com.sskj.qiangjin.ui.activity.NoticeCenterDetailActivity;


public class NoticeCenterActivityPresenter extends BasePresenter<NoticeCenterDetailActivity> {


    /**
     * 公告详情
     *
     * @param id    公告id
     */
    public void noticeMsg(String id) {
        httpService.noticeMsg(id)
                .tag(this)
                .execute(new JsonCallBack<HttpData<NoticeMsgBean>>(this) {
                    @Override
                    public void onSuccess(Response<HttpData<NoticeMsgBean>> response) {
                        HttpData httpData = response.body();
//                        ToastUtil.showShort(httpData.msg);
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updataMsg((NoticeMsgBean) httpData.getData());
                        }
                    }
                });
    }


}
